<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="../../angular-1.5.8/angular.js"> </script>
</head>
<body>
    <div ng-app="mainApp" ng-controller="mainController">
        <form action=".index.ashx" method="get">
             <textarea name="txt" id="" cols="30" rows="10">abc</textarea>
            <input type="submit">
        </form>
        <hr>
       用户名<input type="text" ng-model="name"> 
       密码<input type="password" ng-model="password">
       <input type="button" value ="登录" ng-click="func()">
        <div>{{message}}</div>
    </div>
</body>
<script>
    angular.module('mainApp' ,[])
        .controller('mainController',function ($scope){
            $scope.func=function (){
                var name=$scope.name,
                    password=$scope.password;
                $scope.message=
                    (name&&name.trim().length>0)&&(password&&password.trim().length>0)
                    ?'登录成功'
                    :'请输入完整信息';
            }
        })
</script>
</html>